public class AccountExtensionController {
	
	public Account Accnt {get; set;}
	private ApexPages.StandardController solnController;
	private  String normalNewUrl;
	private String accountRequestUrl;
	private String RecType;
	
	public AccountExtensionController(ApexPages.StandardController stdController) {
        solnController = stdController;
        Accnt = (Account)stdController.getRecord();
        Schema.DescribeSObjectResult descResult = stdController.getSubject().getSObjectType().getDescribe(); 
		String objType = descResult.getLocalName();
        normalNewUrl = '/'+descResult.getKeyPrefix()+'/e?nooverride=1';       
    }
    
	public Pagereference Initialise(){
		Pagereference retURL = new PageReference(NormalNewUrl);
		
		//Determine record type of new account
		Schema.DescribeSObjectResult R = Account.SObjectType.getDescribe();
		Map<ID,Schema.RecordTypeInfo> recTypesMap = R.getRecordTypeInfosByID();
        Schema.RecordTypeInfo recTypeInst = recTypesMap.get(Accnt.RecordTypeId);         
        RecType = recTypeInst.getName(); 
        
        //If the account type is 'account request' then bypass the detail page after saving
        if(RecType == 'account request'){
        	retURL.getParameters().put('saveURL', 'https://na7.salesforce.com/001/o');
        }
		return retURL;
	}
}